<?php

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 * Description of index
 *
 * @author gangguo
 * 
 * 入口文件
 * 1,定义常量
 * 2,引入函数库
 * 3,启动框架
 */

//当前框架所在的根目录
define('FastPHP',  realpath('./'));
//框架核心文件的目录
define('CORE',FastPHP.'/core');
//项目目录
define('APP','app');

require 'vendor/autoload.php';

//是否开启调试模式
define('DEBUG', true);

if(DEBUG){
    ini_set('display_error', 'on');
    $whoops = new \Whoops\Run;
    $errorTitle = '框架报错lalalalalal';
    $handler = new \Whoops\Handler\PrettyPageHandler;
    $handler->setPageTitle($errorTitle); 
    $whoops->pushHandler($handler);
    $whoops->register();
    
}else{
    ini_set('display_error', 'off');
}


include CORE.'/common/function.php';

include CORE.'/FastPHP.php';

spl_autoload_register('\core\FastPHP::load');

\core\FastPHP::run();